﻿using System.Xml;
using repliback4.Net.Protocol.Messages;
using System;


namespace repliback4.Net.Protocol.States {

    public class UnknowStepStateException : Exception {
        ReplibackTag tag;
        State state;

        public ReplibackTag Tag { get { return this.tag; } }
        public State State { get { return this.state; } }

        public UnknowStepStateException ( String message, State state, ReplibackTag tag )
            : base( message ) {
            this.tag = tag;
            this.state = state;
        }
    }

    public abstract class State {

        protected StateManager manager;

        protected State ( StateManager manager ) {
            this.manager = manager;
        }

        public virtual void ExecuteXmlDeclaration ( XmlNode xmlDeclaration ) {
            throw new NotImplementedException( "should be implemented in derived class" );
        }

        public virtual void ExecuteStreamStart ( repliback4.Net.Protocol.Messages.BaseStream stream ) {
            throw new NotImplementedException( "should be implemented in derived class" );
        }

        public virtual void ExecuteTag ( repliback4.Net.Protocol.Messages.ReplibackTag stanza ) {
            throw new NotImplementedException( "should be implemented in derived class" );
        }

        public virtual void ExecuteStreamEnd ( repliback4.Net.Protocol.Messages.BaseStream stream ) {
            throw new NotImplementedException( "should be implemented in derived class" );
        }

        public virtual void ExecuteStreamError ( ) {
            throw new NotImplementedException( "should be implemented in derived class" );
        }
    }


}
